package pishen;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.HashMap;

public class PageRankGraph implements Serializable {
	private static final long serialVersionUID = 5986529973687848296L;
	private HashMap<String, AuthorNode> authorNodeMap = new HashMap<String, AuthorNode>();
	private ArrayList<AuthorNode> authorNodeList = new ArrayList<AuthorNode>();

	public void addAuthorNode(AuthorNode authorNode) {
		authorNodeMap.put(authorNode.getName(), authorNode);
		authorNodeList.add(authorNode);
	}

	public AuthorNode getAuthorNode(String name) {
		return authorNodeMap.get(name);
	}

	public int getNumOfAuthorNode() {
		return authorNodeList.size();
	}

	public AuthorNode getAuthorNode(int index) {
		return authorNodeList.get(index);
	}

}
